@extends('admin.layouts.admin')
@section('header')
    <style>
        .editormd-toolbar{
            position: absolute !important;
            width: 100% !important;
            left: 0px !important;
        }
        .task-list-item-checkbox{
            display: block;
        }
    </style>
@endsection
@section('content')
    <div class="layui-form" lay-filter="LAY-edit-forms" id="LAY-edit" style="padding: 20px 30px 0 0;">
        <div class="layui-form" lay-filter="LAY-add-forms" id="LAY-add" style="padding: 20px 30px 0 0;">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input" value="{{$data->name}}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block">
                    <input type="password" name="password" placeholder="密码" autocomplete="off" class="layui-input"  onkeyup="this.value=this.value.replace(/^\s+|\s+$/g,'')" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色</label>
                <div class="layui-input-block">
                    <select name="role_id"  lay-search="">
                        <option value="">直接选择或搜索选择</option>
                        @foreach($role as $value)
                            <option value="{{$value['id']}}" @if($data->roles_id == $value['id']) selected @endif>{{$value['display_name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>

            <div class="layui-form-item layui-hide">
                <input type="button" lay-submit lay-filter="LAY-add-forms" id="LAY-add-forms" value="确认">
            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-edit-forms" id="LAY-edit-forms" value="确认">
        </div>
    </div>

@endsection
@section('scripts')
    <script>
        layui.config({
            base: '../' //静态资源所在路径
        }).use([ 'table', 'form'], function(){
            var $ = layui.$
                ,form = layui.form
            form.render('checkbox');


        });//use

    </script>
@stop
